<?= $this->element('lookup_passage'); ?>
<h1><?= $book_name ?> <?= $chapter ?></h1>
<?
$next_and_previous_chapters = $this->element('next_and_previous_chapters');
echo $next_and_previous_chapters;

foreach($verses as $verse): ?>
<?
if(!empty($begin_verse) && !empty($end_verse)
		&& $end_verse != 999
		&& !($begin_verse == 1 && $end_verse == sizeof($verses))
		&& (int) $verse['Verse']['verse'] == $begin_verse) {
	echo '<span class="highlighted">';
}
?>
<span id="<?= $verse['Verse']['verse'] ?>" class="verse"><span class="verse-number"><?= $verse['Verse']['verse'] ?></span> <?= $verse['Verse']['text'] ?></span><?
if(!empty($begin_verse) && !empty($end_verse)
		&& $end_verse != 999
		&& !($begin_verse == 1 && $end_verse == sizeof($verses))
		&& (int) $verse['Verse']['verse'] == $end_verse) {
	echo '</span> ';
}
?> <? endforeach; ?>
<?= $next_and_previous_chapters; ?>
<? if(!empty($begin_verse) && $begin_verse != 1): ?>
<script>
location.href = '#<?= $begin_verse ?>';
</script>
<? endif; ?>